package com.daxia.bumall.model;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import org.springframework.format.annotation.DateTimeFormat;

/**
 * BrowseRecord
 */
@Entity
@Table(name = "browserecord") 
public class BrowseRecord extends BaseModel {
	
	public BrowseRecord() {
	}
	
	public BrowseRecord(Long id) {
		this.id = id;
	}
	
	/**
	 * id
	 */
	@Id
	@GeneratedValue
	@Column(name = "id")
    private Long id;
	/**
	 * 浏览用户
	 */
	@ManyToOne
	@JoinColumn(name = "user_id")
    private User user;
	/**
	 * 商品类别
	 */
	@ManyToOne
	@JoinColumn(name = "specification_id")
    private Specification specification;
	/**
	 * 浏览时间
	 */
	@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")	
	@Column(name = "browseTime")
    private Date browseTime;
	
	public Long getId() {
    	return id;
    }
	
    public void setId(Long id) {
    	this.id = id;
    }
	
	public User getUser() {
    	return user;
    }
	
    public void setUser(User user) {
    	this.user = user;
    }
	
	public Specification getSpecification() {
    	return specification;
    }
	
    public void setSpecification(Specification specification) {
    	this.specification = specification;
    }
	
	public Date getBrowseTime() {
    	return browseTime;
    }
	
    public void setBrowseTime(Date browseTime) {
    	this.browseTime = browseTime;
    }
	
}
